import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    sheepName: '',
    sheepNum: '',
    diameterMax: '',
    diameterMin: '',
    sheepId: ''
  },
  mutations: {
    // transmit(state, [sheepName, sheepNum]) {
    //   state.sheepName = sheepName
    //   state.sheepNum = sheepNum
    // },
    // emptyValue(state) {
    //   state.sheepName = ''
    //   state.sheepNum = ''
    //   console.log(state.sheepName, state.sheepNum);
    // },
    // 绒质信息下的数据分析双击跳转到细度检测时存放的直径最大值和最小值区间
    diameterInterval(state, name) {
      const clickValueArr = name.split("--");
      state.diameterMin = Number(clickValueArr[0]);
      state.diameterMax = Number(clickValueArr[1]);
    },
    // 使用完数据后置空
    emptyDiameter(state) {
      state.diameterMax = ''
      state.diameterMin = ''
    },
    // 羊群信息下的系谱档案点击对应编号跳转到对应卡片信息时存放的羊只编号
    jumpToCardInfo(state, sheepId) {
      state.sheepId = sheepId
    },
    // 使用完数据后置空
    emptySheepId(state) {
      state.sheepId = '';
    }
  },
  actions: {

  },
  modules: {

  }
})